<template>
  <div class="main">
    <el-table :data="tableData" stripe style="width: 100%" @row-click="rowClick" size="small">
      <el-table-column align="center" label="序号" width="80">
        <template v-slot="scope">
          {{ (pageInfo.page - 1) * 10 + scope.$index + 1 }}
        </template>
      </el-table-column>
      <el-table-column prop="tucket_type" label="工作票类型" width="100" />
      <el-table-column prop="tucket_code" label="工作票号码" width="100" />
      <el-table-column prop="tucket_guardian" label="工作监护人" />
      <el-table-column prop="tucket_charge" label="工作负责人" />
      <el-table-column prop="tucket_team" label="工作组成员" />
      <el-table-column prop="tucket_number" label="工作组成员人数" />
      <el-table-column prop="tucket_location" label="工作地点" />
      <el-table-column prop="tucket_content" label="工作内容" />
      <el-table-column prop="tucket_plan_beg" label="计划开始时间" />
      <el-table-column prop="tucket_plan_end" label="计划结束时间" />
      <el-table-column prop="tucket_end" label="终结时间" />
      <el-table-column prop="tucket_sta" label="工作票状态" />
    </el-table>
  </div>
</template>
<script>
import sppApi from '@/api/spp'
export default {
  name: 'TicketList',
  props: {
    ticketSta: {
      type: String,
      default: '0'
    }
  },
  watch: {
    ticketSta(newValue) {
      Object.assign(this.pageInfo, newValue)
    }
  },
  data() {
    return {
      tableData: [],
      total: 0,
      pageInfo: { page: 1, ticketSta: '0' },
      dialogTableVisible: false,
      plateNo: '',
      crossDate: '',
      dialogTitle: '人员轨迹信息'
    }
  },
  mounted() {
    this.initLoadData()
  },
  methods: {
    initLoadData() {
      sppApi.getTicketListBySta().then((res) => {
        if (res.code === 200) {
          this.tableData = res.data
        }
      })
    }
  }
}
</script>
